( function( $){ 'use strict'; if(typeof wpcf7==='undefined' || wpcf7===null){ return; } wpcf7=$.extend({ cached:0, inputs:[] }, wpcf7); $( function(){ wpcf7.supportHtml5=( function(){ var features={}; var input=document.createElement('input'); features.placeholder='placeholder' in input; var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ]; $.each(inputTypes, function( index, value){ input.setAttribute('type', value); features[ value ]=input.type!=='text'; }); return features; })(); $( 'div.wpcf7 > form').each(function(){ var $form=$( this); wpcf7.initForm($form); if(wpcf7.cached){ wpcf7.refill($form); }}); }); wpcf7.getId=function( form){ return parseInt( $( 'input[name="_wpcf7"]', form).val(), 10); }; wpcf7.initForm=function( form){ var $form=$( form); wpcf7.setStatus($form, 'init'); $form.submit(function( event){ if(! wpcf7.supportHtml5.placeholder){ $( '[placeholder].placeheld', $form).each(function( i, n){ $( n).val('').removeClass('placeheld'); }); } if(typeof window.FormData==='function'){ wpcf7.submit($form); event.preventDefault(); }}); $( '.wpcf7-submit', $form).after(''); wpcf7.toggleSubmit($form); $form.on('click', '.wpcf7-acceptance', function(){ wpcf7.toggleSubmit($form); }); $( '.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){ var name=$( this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false); }); $( '.wpcf7-list-item.has-free-text', $form).each(function(){ var $freetext=$( ':input.wpcf7-free-text', this); var $wrap=$( this).closest('.wpcf7-form-control'); if($( ':checkbox,:radio', this).is(':checked')){ $freetext.prop('disabled', false); }else{ $freetext.prop('disabled', true); } $wrap.on('change', ':checkbox,:radio', function(){ var $cb=$( '.has-free-text', $wrap).find(':checkbox,:radio'); if($cb.is(':checked')){ $freetext.prop('disabled', false).focus(); }else{ $freetext.prop('disabled', true); }}); }); if(! wpcf7.supportHtml5.placeholder){ $( '[placeholder]', $form).each(function(){ $( this).val($( this).attr('placeholder')); $( this).addClass('placeheld'); $( this).focus(function(){ if($( this).hasClass('placeheld')){ $( this).val('').removeClass('placeheld'); }}); $( this).blur(function(){ if(''===$( this).val()){ $( this).val($( this).attr('placeholder')); $( this).addClass('placeheld'); }}); }); } if(wpcf7.jqueryUi && ! wpcf7.supportHtml5.date){ $form.find('input.wpcf7-date[type="date"]').each(function(){ $( this).datepicker({ dateFormat:'yy-mm-dd', minDate:new Date( $( this).attr('min')), maxDate:new Date( $( this).attr('max')) }); }); } if(wpcf7.jqueryUi && ! wpcf7.supportHtml5.number){ $form.find('input.wpcf7-number[type="number"]').each(function(){ $( this).spinner({ min:$( this).attr('min'), max:$( this).attr('max'), step:$( this).attr('step') }); }); } wpcf7.resetCounter($form); $form.on('change', '.wpcf7-validates-as-url', function(){ var val=$.trim($( this).val()); if(val && ! val.match(/^[a-z][a-z0-9.+-]*:/i) && -1!==val.indexOf('.')){ val=val.replace(/^\/+/, ''); val='http://' + val; } $( this).val(val); }); }; wpcf7.submit=function( form){ if(typeof window.FormData!=='function'){ return; } var $form=$( form); $( '.ajax-loader', $form).addClass('is-active'); wpcf7.clearResponse($form); var formData=new FormData( $form.get(0)); var detail={ id:$form.closest('div.wpcf7').attr('id'), status:'init', inputs:[], formData:formData }; $.each($form.serializeArray(), function( i, field){ if('_wpcf7'==field.name){ detail.contactFormId=field.value; } else if('_wpcf7_version'==field.name){ detail.pluginVersion=field.value; } else if('_wpcf7_locale'==field.name){ detail.contactFormLocale=field.value; } else if('_wpcf7_unit_tag'==field.name){ detail.unitTag=field.value; } else if('_wpcf7_container_post'==field.name){ detail.containerPostId=field.value; } else if(field.name.match(/^_/)){ }else{ detail.inputs.push(field); }}); wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess=function( data, status, xhr, $form){ detail.id=$( data.into).attr('id'); detail.status=data.status; detail.apiResponse=data; switch ( data.status){ case 'init': wpcf7.setStatus($form, 'init'); break; case 'validation_failed': $.each(data.invalid_fields, function( i, n){ $( n.into, $form).each(function(){ wpcf7.notValidTip(this, n.message); $( '.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $( '.wpcf7-form-control', this).attr('aria-describedby', n.error_id ); $( '[aria-invalid]', this).attr('aria-invalid', 'true'); }); }); wpcf7.setStatus($form, 'invalid'); wpcf7.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': wpcf7.setStatus($form, 'unaccepted'); wpcf7.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': wpcf7.setStatus($form, 'spam'); wpcf7.triggerEvent(data.into, 'spam', detail); break; case 'aborted': wpcf7.setStatus($form, 'aborted'); wpcf7.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': wpcf7.setStatus($form, 'sent'); wpcf7.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': wpcf7.setStatus($form, 'failed'); wpcf7.triggerEvent(data.into, 'mailfailed', detail); break; default: wpcf7.setStatus($form, 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-') ); } wpcf7.refill($form, data); wpcf7.triggerEvent(data.into, 'submit', detail); if('mail_sent'==data.status){ $form.each(function(){ this.reset(); }); wpcf7.toggleSubmit($form); wpcf7.resetCounter($form); } if(! wpcf7.supportHtml5.placeholder){ $form.find('[placeholder].placeheld').each(function( i, n){ $( n).val($( n).attr('placeholder')); }); } $( '.wpcf7-response-output', $form) .html('').append(data.message).slideDown('fast'); $( '.screen-reader-response', $form.closest('.wpcf7')).each(function(){ var $response=$( this); $( '[role="status"]', $response).html(data.message); if(data.invalid_fields){ $.each(data.invalid_fields, function( i, n){ if(n.idref){ var $li=$( '
').append($( '').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$( '').append(n.message); } $li.attr('id', n.error_id); $( 'ul', $response).append($li); }); }}); if(data.posted_data_hash){ $form.find('input[name="_wpcf7_posted_data_hash"]').first() .val(data.posted_data_hash); }}; $.ajax({ type:'POST', url:wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data:formData, dataType:'json', processData:false, contentType:false }).done(function( data, status, xhr){ ajaxSuccess( data, status, xhr, $form); $( '.ajax-loader', $form).removeClass('is-active'); }).fail(function( xhr, status, error){ var $e=$( '').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function( target, name, detail){ var event=new CustomEvent( 'wpcf7' + name, { bubbles:true, detail:detail }); $( target).get(0).dispatchEvent(event); }; wpcf7.setStatus=function( form, status){ var $form=$( form); var prevStatus=$form.attr('data-status'); $form.data('status', status); $form.addClass(status); $form.attr('data-status', status); if(prevStatus && prevStatus!==status){ $form.removeClass(prevStatus); }} wpcf7.toggleSubmit=function( form, state){ var $form=$( form); var $submit=$( 'input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $( '.wpcf7-acceptance', $form).each(function(){ var $span=$( this); var $input=$( 'input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert') && $input.is(':checked') || ! $span.hasClass('invert') && ! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.resetCounter=function( form){ var $form=$( form); $( '.wpcf7-character-count', $form).each(function(){ var $count=$( this); var name=$count.attr('data-target-name'); var down=$count.hasClass('down'); var starting=parseInt( $count.attr('data-starting-value'), 10); var maximum=parseInt( $count.attr('data-maximum-value'), 10); var minimum=parseInt( $count.attr('data-minimum-value'), 10); var updateCount=function( target){ var $target=$( target); var length=$target.val().length; var count=down ? starting - length:length; $count.attr('data-current-value', count); $count.text(count); if(maximum && maximum < length){ $count.addClass('too-long'); }else{ $count.removeClass('too-long'); } if(minimum && length < minimum){ $count.addClass('too-short'); }else{ $count.removeClass('too-short'); }}; $( ':input[name="' + name + '"]', $form).each(function(){ updateCount( this); $( this).keyup(function(){ updateCount( this); }); }); }); }; wpcf7.notValidTip=function( target, message){ var $target=$( target); $( '.wpcf7-not-valid-tip', $target).remove(); $( '').attr({ 'class':'wpcf7-not-valid-tip', 'aria-hidden':'true', }).text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function( target){ $( target).not(':hidden').animate({ opacity:0 }, 'fast', function(){ $( this).css({ 'z-index':-100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut( this); }); $target.on('focus', ':input', function(){ fadeOut( $( '.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function( form, data){ var $form=$( form); var refillCaptcha=function( $form, items){ $.each(items, function( i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function( $form, items){ $.each(items, function( i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type:'GET', url:wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend:function( xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType:'json' }).done(function( data, status, xhr){ if(data.captcha){ refillCaptcha( $form, data.captcha); } if(data.quiz){ refillQuiz( $form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha( $form, data.captcha); } if(data.quiz){ refillQuiz( $form, data.quiz); }} }; wpcf7.clearResponse=function( form){ var $form=$( form); $form.siblings('.screen-reader-response').each(function(){ $( '[role="status"]', this).html(''); $( 'ul', this).html(''); }); $( '.wpcf7-not-valid-tip', $form).remove(); $( '[aria-invalid]', $form).attr('aria-invalid', 'false'); $( '.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $( '.wpcf7-response-output', $form).hide().empty(); }; wpcf7.apiSettings.getRoute=function( path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})( jQuery); ( function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent ( event, params){ params=params || { bubbles:false, cancelable:false, detail:undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(){"use strict";function t(t,s){if(this.el=t,this.$el=e(t),this.s=e.extend({},o,s),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=e(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(e(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var o={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};t.prototype.init=function(){var t=this;t.s.preload>t.$items.length&&(t.s.preload=t.$items.length);var o=window.location.hash;o.indexOf("lg="+this.s.galleryId)>0&&(t.index=parseInt(o.split("&slide=")[1],10),e("body").addClass("lg-from-hash"),e("body").hasClass("lg-on")||(setTimeout(function(){t.build(t.index)}),e("body").addClass("lg-on"))),t.s.dynamic?(t.$el.trigger("onBeforeOpen.lg"),t.index=t.s.index||0,e("body").hasClass("lg-on")||setTimeout(function(){t.build(t.index),e("body").addClass("lg-on")})):t.$items.on("click.lgcustom",function(o){try{o.preventDefault(),o.preventDefault()}catch(e){o.returnValue=!1}t.$el.trigger("onBeforeOpen.lg"),t.index=t.s.index||t.$items.index(this),e("body").hasClass("lg-on")||(t.build(t.index),e("body").addClass("lg-on"))})},t.prototype.build=function(t){var o=this;o.structure(),e.each(e.fn.lightGallery.modules,function(t){o.modules[t]=new e.fn.lightGallery.modules[t](o.el)}),o.slide(t,!1,!1,!1),o.s.keyPress&&o.keyPress(),o.$items.length>1?(o.arrow(),setTimeout(function(){o.enableDrag(),o.enableSwipe()},50),o.s.mousewheel&&o.mousewheel()):o.$slide.on("click.lg",function(){o.$el.trigger("onSlideClick.lg")}),o.counter(),o.closeGallery(),o.$el.trigger("onAfterOpen.lg"),o.$outer.on("mousemove.lg click.lg touchstart.lg",function(){o.$outer.removeClass("lg-hide-items"),clearTimeout(o.hideBartimeout),o.hideBartimeout=setTimeout(function(){o.$outer.addClass("lg-hide-items")},o.s.hideBarsDelay)}),o.$outer.trigger("mousemove.lg")},t.prototype.structure=function(){var t,o="",s="",i=0,l="",r=this;for(e("body").append(''),e(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),i=0;ix
";d.appendChild(f.childNodes[1])}if(b){a.extend(e,b)}return this.each(function(){var g=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];if(e.customSelector){g.push(e.customSelector)}var h=".fitvidsignore";if(e.ignore){h=h+", "+e.ignore}var i=a(this).find(g.join(","));i=i.not("object object");i=i.not(h);i.each(function(){var n=a(this);if(n.hasClass("jwswf")){return}if(n.parents(h).length>0){return}if(this.tagName.toLowerCase()==="embed"&&n.parent("object").length||n.parent(".fluid-width-video-wrapper").length){return}if((!n.css("height")&&!n.css("width"))&&(isNaN(n.attr("height"))||isNaN(n.attr("width")))){n.attr("height",9);n.attr("width",16)}var j=(this.tagName.toLowerCase()==="object"||(n.attr("height")&&!isNaN(parseInt(n.attr("height"),10))))?parseInt(n.attr("height"),10):n.height(),k=!isNaN(parseInt(n.attr("width"),10))?parseInt(n.attr("width"),10):n.width(),l=j/k;if(!n.attr("id")){var m="fitvid"+Math.floor(Math.random()*999999);n.attr("id",m)}n.wrap('').parent(".fluid-width-video-wrapper").css("padding-top",(l*100)+"%");n.removeAttr("height").removeAttr("width")})})}})(window.jQuery||window.Zepto);